{template "content","header"}
<!--<header class="lc-xsl-hd clearfix">
		<a href="" class="lc-hd-back"></a>
		新丝路超模
		<a href="" class="lc-hd-search"></a>
	</header>-->
	<!-- 图片轮播 -->
	<div class="swiper-container lb-box-2">
  	    <div class="swiper-wrapper lb-wrapper-2">
  	    {pc:poll action="polllist" varname="course_poll" num="4"}
  	    {loop $data $r}
   	        <div class="swiper-slide lb-item-2"><img src="{$r[titlepic]}" alt="" class="lb-pics-2"></div>
   	    {/loop}
   	    {/pc}
  	    </div>
  	    <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets"></div>
	</div>
	<div class="pxrk-atc-box">
		{loop $company_info $data}
		<a href="?m=course&c=index&a=show&id={$data['id']}">
		<div class="pxrk-atc-item">
			{if $data['institutionsLog']==""}
			{else}
			<div class="atc-ico"><img src="{$data['institutionsLog']}" alt="" class="atc-pic"></div>
			{/if}
			<div class="atc-txt">
				<h4 class="atc-tit">{$data['title']}</h4>
				<p class="atc-cont">{$data['description']}</p>
			</div>
		</div>
		</a>
		{/loop}
	</div>
	<div class="v-train-box" id="course-list">
		<ul class="train-ul">
			{loop $course_info $r}
			<a href="?m=course&c=index&a=course_detail&id={$r['id']}">
			<li class="train-li">
				<div class="train-banner">
					<img src="{$r['thumb']}" alt="" class="train-pic">
				</div>
				<div class="train-info">
					<span class="train-tit">{$r['name']}</span>
					<span class="train-clicks">{if $r['number']==""}0{else}{$r['number']}{/if}人看过</span>
				</div>
			</li>
			</a>
			{/loop}
		</ul>
	</div>
	{template "content","newfooter"}
	<script type="text/javascript" src="{JS_PATH}nsr/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="{JS_PATH}nsr/lc_adp.js"></script>
	<script type="text/javascript" src="{JS_PATH}nsr/swiper.min.js"></script>
	<script type="text/javascript" src="{JS_PATH}nsr/lc_js.js"></script>
	<script type="text/javascript">
    var swiper = new Swiper('.swiper-container', {
    	loop: true,
	    slidesPerView:1,
		autoplay: 2000,
        pagination: '.swiper-pagination',
        paginationClickable: true
    }); 
	</script>
	<script type="text/javascript">
        $(function(){
            var tag = 1;
            var nums = $('#course-list li').size();
            if (nums != 5) {
                tag = 0;
            }
            var page = 1;
            $(window).scroll(function(){  
                // 被卷去的高度  
                var scrollTop = document.body.scrollTop||document.documentElement.scrollTop;  
                // 页面高度  
                var pageHeight = $(document).height();  
                // 可视区域高度  
                var viewHeight = $(window).height();  
                //alert(viewHeight);  
                //当滚动到底部时  
                if((scrollTop+viewHeight)>(pageHeight-20) && tag == 1){
                    tag = 0;
                    page++;
                    $.ajax({
                        type: "POST",
                        url: "?m=course&c=index&a=ajax_course",
                        cache: false,
                        dataType:"json",
                        data: {page:page},
                        success: function(result){
                            if (result) {
                                if (result.length == 5) {
                                    tag = 1;
                                } else {
                                    tag = 0;
                                }
                                var _html = '';
                                $.each( result, function(i, n){
                                	_html += '<a href=?m=course&c=index&a=course_detail&id='+n.id+'>';
                                    _html += '<li class="train-li"><div class="train-banner"><img src="';
                                    _html += n.thumb;
                                    _html += '" alt="" class="train-pic"></div><div class="train-info"><span class="train-tit">';
                                    _html += n.name;
                                    _html += '</span><span class="train-clicks">';
                                    if(n.number == null||n.number == ''){
                                    	_html += 0;
                                    }else{
                                    	_html += n.number;
                                    }
                                    _html += '人看过</span></div></li></a>';
                                });
                                $('#course-list ul').append(_html);
                            } else {
                                tag = 0;
                            }
                        },
                        error: function(){
                          alert('请求服务器失败');
                        }
                    }); 
                    //防止无限制的增长
                    if(scrollTop<1000){  
                        return false;     
                    }  
                }  
            });
        })
    </script>
{template "content","footer"}